﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnnealingModel.Demo.Common.Function
{
    [DisplayText(FunctionType.UnaryFunction2, "y=x²-4x-4")]
    internal class UnaryFunction2 : FuntionBase
    {
        public UnaryFunction2()
        {
            this.Range = (0, 4);
            this.Solve = SolveType.Min;
            this.Accuracy = 3;
        }

        public override double Func(params double[] xs)
        {
            // y=x²-4x-4
            double x = xs[0];
            return x * x - 4 * x - 4;
        }
    }
}
